package me.wangqu.weiyouqu.web.rest.dto;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;


/**
 * A DTO for the ViewPager entity.
 */
public class ViewPagerDTO implements Serializable {

    private Long id;

    @NotNull
    @Pattern(regexp = "^[a-zA-z]+://[^\\s]*$")
    private String img;

    @NotNull
    @Pattern(regexp = "^[a-zA-z]+://[^\\s]*$")
    private String url;

    @NotNull
    private Integer type;

    private String title;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        ViewPagerDTO viewPagerDTO = (ViewPagerDTO) o;

        if ( ! Objects.equals(id, viewPagerDTO.id)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "ViewPagerDTO{" +
            "id=" + id +
            ", img='" + img + "'" +
            ", url='" + url + "'" +
            ", type='" + type + "'" +
            ", title='" + title + "'" +
            '}';
    }
}
